<!DOCTYPE html>
<html>

<head>
  <title>文章详情</title>
  <% include layout/lib.ejs %>
  <link rel="stylesheet" type="text/css" href="/css/technologyArticleDetail.css" />
    <script src="/lib/js/showdown.min.js"></script>
    <link href="/lib/css/monokai-sublime.min.css" rel="stylesheet" />
    <script src="/lib/js/highlight.min.js"></script>
</head>

<body>
  <% include layout/header.ejs %>

  <div class="technologyArticleBox">
    <div class="technologyArticleMain">
      <div class="technologyArticleDetailHeader">
        <b style="color:#87a9df;"><%= articleDetail.a_tag %></b> - <a href="#"><%= articleDetail.a_title %></a>
      </div>
      <div class="technologyArticleDetailBox" id="technologyArticleDetailBox"><%= articleDetail.a_content %></div>
    </div>
  </div>

  <% include layout/footer.ejs %>
</body>
<script>
  $(function () {

        var converter = new showdown.Converter();
        var htmlcontent = converter.makeHtml($("#technologyArticleDetailBox").text());
        htmlcontent = htmlcontent.replace(/\n|\r\n/g,"<br>");
        console.log(htmlcontent)
        $("#technologyArticleDetailBox").html(htmlcontent);
        // $('pre code').each(function (i, block) {
        //   hljs.highlightBlock(block);
        // });

    //初始化内容

    /*
    getMd("/md/article/1.md");

    function getMd(mdPath) {

      var nowScrollTop = $('html,body').scrollTop();

      if (nowScrollTop > 0) {
        $('html,body').animate({ scrollTop: 0 }, 0);
      }

      $('html').css('overflow-y', 'hidden');

      POP.startLoading();

      $.get(mdPath, function (res) {

        $('html').css('overflow-y', 'auto');

        POP.endLoading();

        var converter = new showdown.Converter();
        var htmlcontent = converter.makeHtml(res);
        $("#technologyArticleDetailBox").html(htmlcontent);
        $('pre code').each(function (i, block) {
          hljs.highlightBlock(block);
        });


      });

    }
    */

  })
</script>

</html>